#pragma once

#include "Object.h"

class Scene;

class Player :
	public Object
{
public:
	Player(void);
	virtual ~Player(void);

	enum STATE
	{
		STAND,
		IDLE,
		WALK,
		RUN,
		RUN_FAST,
		JUMP,
		SECONDARY_JUMP,

		TACKLE,
		ATTACK,
		KONGFU,

		KICK,
		HELICOPTER,
		BICYCLE,
		SUPER_BICYCLE,

		FAINT,
		SLEEP,
		DIE,

		STATE_MAX
	};

	enum EXSTATE
	{
		NONE,
		WORM,

		EXSTATE_MAX
	};

	STATE	get_state() const { return State; }
	void	set_state(STATE val) { State = val; }
	void	set_state(int val)
	{
		assert(val < STATE_MAX);
		State = static_cast<STATE>(val);
	}

	enum CTRL_CODE
	{
		// Walk
		CTRL_UP,
		CTRL_DOWN,
		CTRL_LEFT,
		CTRL_RIGHT,

		// Run
		CTRL_D_UP,
		CTRL_D_DOWN,
		CTRL_D_LEFT,
		CTRL_D_RIGHT,

		CTRL_SHOOT,				// Shoot
		CTRL_PASS,				// Short pass
		CTRL_LONG_PASS,			// Long pass

		CTRL_TACKLE,

		CTRL_MAX
	};

	bool do_command(CTRL_CODE CtrlCode);

	void clear();

	// This function should be called 12 times per second.
	void tick();

	unsigned int get_speed() const { return Speed; }
	void set_speed(unsigned int val) { Speed = val; }

	bool move_to(const Vector3D<int>& Dest);

private:
	
	STATE	State;
	EXSTATE	ExState;
	bool	bWithBall;

	unsigned int Speed;

	Scene *CurrentScene;

public:
	virtual const char* signature() const { return Signature; }
private:
	static const char* Signature;
};



